package br.com.decon.modelo.entidade;

public class Pedido {
	
	private Integer num;
	private String tipo;
	private Secretaria secretaria;
	private Double valor;
	private String historico;
	private Integer fonte;
	private String elementoDesp;
	private String obs;
	
	public Pedido(Integer num, String tipo, Secretaria secretaria,
			Double valor, String historico, Integer fonte, String elementoDesp,
			String obs) {
		this();
		this.num = num;
		this.tipo = tipo;
		this.secretaria = secretaria;
		this.valor = valor;
		this.historico = historico;
		this.fonte = fonte;
		this.elementoDesp = elementoDesp;
		this.obs = obs;
	}

	public Pedido() {
		super();
	}

	public Integer getNum() {
		return num;
	}

	public void setNum(Integer num) {
		this.num = num;
	}

	public String getTipo() {
		return tipo;
	}

	public void setTipo(String tipo) {
		this.tipo = tipo;
	}

	public Secretaria getSecretaria() {
		return secretaria;
	}

	public void setSecretaria(Secretaria secretaria) {
		this.secretaria = secretaria;
	}

	public Double getValor() {
		return valor;
	}

	public void setValor(Double valor) {
		this.valor = valor;
	}

	public String getHistorico() {
		return historico;
	}

	public void setHistorico(String historico) {
		this.historico = historico;
	}

	public Integer getFonte() {
		return fonte;
	}

	public void setFonte(Integer fonte) {
		this.fonte = fonte;
	}

	public String getElementoDesp() {
		return elementoDesp;
	}

	public void setElementoDesp(String elementoDesp) {
		this.elementoDesp = elementoDesp;
	}

	public String getObs() {
		return obs;
	}

	public void setObs(String obs) {
		this.obs = obs;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Pedido [num=").append(num).append(", tipo=")
				.append(tipo).append(", secretaria=").append(secretaria)
				.append(", valor=").append(valor).append(", historico=")
				.append(historico).append(", fonte=").append(fonte)
				.append(", elementoDesp=").append(elementoDesp)
				.append(", obs=").append(obs).append("]");
		return builder.toString();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((elementoDesp == null) ? 0 : elementoDesp.hashCode());
		result = prime * result + ((fonte == null) ? 0 : fonte.hashCode());
		result = prime * result
				+ ((historico == null) ? 0 : historico.hashCode());
		result = prime * result + ((num == null) ? 0 : num.hashCode());
		result = prime * result + ((obs == null) ? 0 : obs.hashCode());
		result = prime * result
				+ ((secretaria == null) ? 0 : secretaria.hashCode());
		result = prime * result + ((tipo == null) ? 0 : tipo.hashCode());
		result = prime * result + ((valor == null) ? 0 : valor.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Pedido other = (Pedido) obj;
		if (elementoDesp == null) {
			if (other.elementoDesp != null)
				return false;
		} else if (!elementoDesp.equals(other.elementoDesp))
			return false;
		if (fonte == null) {
			if (other.fonte != null)
				return false;
		} else if (!fonte.equals(other.fonte))
			return false;
		if (historico == null) {
			if (other.historico != null)
				return false;
		} else if (!historico.equals(other.historico))
			return false;
		if (num == null) {
			if (other.num != null)
				return false;
		} else if (!num.equals(other.num))
			return false;
		if (obs == null) {
			if (other.obs != null)
				return false;
		} else if (!obs.equals(other.obs))
			return false;
		if (secretaria == null) {
			if (other.secretaria != null)
				return false;
		} else if (!secretaria.equals(other.secretaria))
			return false;
		if (tipo == null) {
			if (other.tipo != null)
				return false;
		} else if (!tipo.equals(other.tipo))
			return false;
		if (valor == null) {
			if (other.valor != null)
				return false;
		} else if (!valor.equals(other.valor))
			return false;
		return true;
	}	
}
